<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>意达设计</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../css/dealer.css"/>

</head>
<body class="body">

<!-- header -->
<div class="detban">
	<img class="daimg" src="../image/page/img-022.jpg" id='icon' style="width: 358px;height: 353px;">
	<div class="detailheader">
		<a href="javascript:void(0);" onclick="api.closeWin();" class="retue"></a>
		<a href="javascript:void(0);" class="sharelink"></a>
	</div>
</div>

<div class="deltit"><span id='name'>HELEN手提时尚女包</span><a href="javascript:void(0)"></a></div>
<div class="delmony"><span id='price'>￥1688</span></div>

<div class="pad">
	<div class="modeli"><span>订单号</span> <em id='orderno'>2018091117361529</em></div>
	<div class="modeli"><span>颜色</span> <em  id='color'>红色、黄色、紫色</em></div>
	<div class="modeli"><span>数量</span> <em id='num'>X10</em></div>
	<div class="modeli"><span>总价</span> <p>¥<i id='money'>10050.00</i></p></div>
</div>

<div class="nullbox"></div>
<div class="modeft">
	<a href="#" class="midl1" onclick='backorder()'>申请退单</a>
	<a href="#" class="midl2" onclick='delorder()'>删除订单</a>
</div>







</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../script/adaptive.js"></script>
<script type="text/javascript" src="../script/swiper.min.js"></script>
<script type="text/javascript" src="../script/tabs.js"></script>
<script type="text/javascript">
    window['adaptive'].desinWidth = 750;
    window['adaptive'].baseFont = 28;
    window['adaptive'].maxWidth = 750;
    window['adaptive'].init();

    apiready = function () {
        $api.fixStatusBar($api.dom('.header'));
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err){
            api.closeWidget();
        });
        api.showProgress();

        var para=api.pageParam;
    

    	var  p={token:token,id:para.id};

        toDoRequest();

      
        function toDoRequest(){
			api.ajax({
	            url: webSiteUrl+'/app/user/orderdetail',
	            method: 'post',
	            data: {
	                values:p,
	            }
	        }, function(ret, err) {
	            api.hideProgress();
	            
	            if(ret.code==200){
	                
	                //alert(ret.msg);return;
	              
	               
	                var tj=ret.data;
                    $('#icon').attr('src',webSiteUrl+tj.icon);
	                $('#price').html('¥'+tj.price);
	    			$('#money').html(tj.money);
	    			$('#time').html(tj.time);
	    			$('#name').html(tj.name);
	    			$('#orderno').html(tj.orderno);
	    			$('#color').html(tj.color);
	    			$('#num').html(tj.num);

	                		
	            }else{
	                        //alert(ret.msg)
	                    }

			});
    	}

    


  };
	 function delorder(){

        api.confirm( {
          title: '提醒',
          msg: '确认删除订单？',
          buttons: [ '确定', '取消' ]
        }, function ( ret, err ) {
          var index = ret.buttonIndex;
            if ( index == 1 ) {
            

                var para=api.pageParam
                var p={token:token,id:para.id};

                api.ajax({
                    url: webSiteUrl+'/app/user/delorder',
                    method: 'post',
                    data: {
                        values:p,
                    }
                }, function(ret, err) {
                    api.hideProgress();
                    
                    if(ret.code==200){
                        api.toast( {
                          msg:ret.msg,
                          duration: 2000,
                          location: 'middle'
                        },function(){
                            api.openWin({
                            name: 'shopName',
                            url: './myorder.html',
                            pageParam: {
                                type: 1,
                            }
                            });
                        });
                    
                    }else{
                        alert(ret.msg)
                    }
                });
            }
        });

	  	
   	}
   	function backorder(){ 
   		var para=api.pageParam
   		api.openWin({
            name: 'shopName',
            url: './backorder.html',
            pageParam: {
                id: para.id
            }
        });
   	}
</script>

</html>
